Skip to main content

Class WeakConcurrentCollection<T>

An implementation of a weak concurrent set based on a System.Runtime.CompilerServices.ConditionalWeakTable%602.

Assembly: Dalamud.dll
View Source
Declaration
public class WeakConcurrentCollection<T> : ICollection<T>, IEnumerable<T>, IEnumerable where T : class

Implements:
System.Collections.Generic.ICollection<<T>>, System.Collections.Generic.IEnumerable<<T>>, System.Collections.IEnumerable

Properties

Count

Gets the number of elements contained in the System.Collections.Generic.ICollection%601.

View Source
Declaration
public int Count { get; }

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection%601 is read-only.

View Source
Declaration
public bool IsReadOnly { get; }

Methods

GetEnumerator()

Returns an enumerator that iterates through the collection.

View Source
Declaration
public IEnumerator<T> GetEnumerator()
Returns

System.Collections.Generic.IEnumerator<<T>>: An enumerator that can be used to iterate through the collection.### Add(T) Adds an item to the System.Collections.Generic.ICollection%601.

View Source
Declaration
public void Add(T item)
Parameters
TypeNameDescription
<T>itemThe object to add to the System.Collections.Generic.ICollection%601.
Exceptions

System.NotSupportedException
The System.Collections.Generic.ICollection%601 is read-only.

Clear()

Removes all items from the System.Collections.Generic.ICollection%601.

View Source
Declaration
public void Clear()
Exceptions

System.NotSupportedException
The System.Collections.Generic.ICollection%601 is read-only.

Contains(T)

Determines whether the System.Collections.Generic.ICollection%601 contains a specific value.

View Source
Declaration
public bool Contains(T item)
Returns

System.Boolean: true if <code class="paramref">item</code> is found in the System.Collections.Generic.ICollection%601; otherwise, false.

Parameters
TypeNameDescription
<T>itemThe object to locate in the System.Collections.Generic.ICollection%601.

CopyTo(T[], int)

Copies the elements of the System.Collections.Generic.ICollection%601 to an System.Array, starting at a particular System.Array index.

View Source
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
TypeNameDescription
<T>[]arrayThe one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection%601. The System.Array must have zero-based indexing.
System.Int32arrayIndexThe zero-based index in <code class="paramref">array</code> at which copying begins.
Exceptions

System.ArgumentNullException
<code class="paramref">array</code> is null. System.ArgumentOutOfRangeException
<code class="paramref">arrayIndex</code> is less than 0. System.ArgumentException
The number of elements in the source System.Collections.Generic.ICollection%601 is greater than the available space from <code class="paramref">arrayIndex</code> to the end of the destination <code class="paramref">array</code>.

Remove(T)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection%601.

View Source
Declaration
public bool Remove(T item)
Returns

System.Boolean: true if <code class="paramref">item</code> was successfully removed from the System.Collections.Generic.ICollection%601; otherwise, false. This method also returns false if <code class="paramref">item</code> is not found in the original System.Collections.Generic.ICollection%601.

Parameters
TypeNameDescription
<T>itemThe object to remove from the System.Collections.Generic.ICollection%601.
Exceptions

System.NotSupportedException
The System.Collections.Generic.ICollection%601 is read-only.

Implements

  • System.Collections.Generic.ICollection<<T>>
  • System.Collections.Generic.IEnumerable<<T>>
  • System.Collections.IEnumerable